// 备份.第一步: register repository, 必须提前配置 /usr/share/elasticsearch/config/elasticsearch.yml 的 path.repo: ["/back"], 已配好
PUT /_snapshot/back
{
  "type": "fs",
  "settings": {
    "location": "/back"
  }
}

// 备份.第二步: create a snapshot, 不传body, 表示为全部索引
PUT /_snapshot/back/snapshot_20201021?wait_for_completion=true
{
  "indices": "store,goods,nginx",
  "ignore_unavailable": true,
  "include_global_state": false,
  "metadata": {
    "taken_by": "suxiang",
    "taken_because": "Archive"
  }
}

// 查看
GET /_snapshot/back/snapshot_20201021

// 恢复 注意rename_pattern
POST /_snapshot/back/snapshot_20201021/_restore
{
  "indices": "store,goods,nginx",
  "ignore_unavailable": true,
  "include_global_state": false,              
  "rename_pattern": "index_(.+)",
  "rename_replacement": "restored_index_$1",
  "include_aliases": false
}
// 删除
DELETE /_snapshot/back/snapshot_20201021